package netty.myDecoder;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * @Description TODO
 * @Author 李龙平
 * @Date 2020/10/13 17:38
 */
public class MyClientInitor extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline pipeline = socketChannel.pipeline();
        //在出栈之前  对数据行进编码
        pipeline.addLast(new MyLongTobyteDecoder());
        //add处理业务handler
        pipeline.addLast(new MyClentHandler());
    }
}
